package com.ctshk.sapp.hotel.APIUtils;

import static com.ctshk.sapp.hotel.APIUtils.APIUtil.callAPIFunc;

public class WestminsterApi {
    public static void main(String[] args) {
        String param = "<?xml version=\"1.0\"?>\n" +
                "<OTA_HotelResRQ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
                "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" Version=\"0\"\n" +
                "xmlns=\"http://www.opentravel.org/OTA/2003/05\">\n" +
                "<POS>\n" +
                " 30<Source ISOCountry=\"HK\">\n" +
                "1,2<RequestorID ID=\"api@ctshk.com\" MessagePassword=\"111111\"/>\n" +
                " </Source>\n" +
                "</POS>\n" +
                " <HotelReservations>"+
                "<HotelReservation>\n" +
                " 27<UniqueID ID=\"PKG001\" ID_Context=\"XXX\">\n" +
                " <RoomStays>\n" +
                " <RoomStay>\n" +
                " <RoomTypes>\n" +
                " 3,4<RoomType RoomType=\"Standard 2 Beds(Twin)\" RoomTypeCode=\"2@13379_0\" />\n" +
                " </RoomTypes>\n" +
                " <RatePlans>\n" +
                " 5<RatePlan RatePlanID=\"0005-F\" />\n" +
                " </RatePlans>\n" +
                " 6,7<TimeSpan Start=\"2021-03-22\" End=\"2021-03-25\" />\n" +
                " 8<BasicPropertyInfo HotelCode=\"12345\" />\n" +
                " 9<ResGuestRPHs>1 2</ResGuestRPHs>\n" +
                " 28,29<Total AmountBeforeTax=\"18660.0\" CurrencyCode=\"HKD\"/>\n" +
                " </RoomStay>\n" +
                " <RoomStay>\n" +
                " <RoomTypes>\n" +
                " <RoomType RoomType=\"Standard 2 Beds(Twin)\" RoomTypeCode=\"2@13379_0\" />\n" +
                " </RoomTypes>\n" +
                " <RatePlans>\n" +
                " <RatePlan RatePlanID=\"0005-F\" />\n" +
                " </RatePlans>\n" +
                " <TimeSpan Start=\"2021-03-22\" End=\"2021-03-25\" />\n" +
                " <Guarantee>\n" +
                " <GuaranteeDescription>\n" +
                " <Text />\n" +
                " </GuaranteeDescription>\n" +
                " </Guarantee>\n" +
                " <BasicPropertyInfo HotelCode=\"12345\" />\n" +
                " <ResGuestRPHs>3 4</ResGuestRPHs>\n" +
                " <Total AmountBeforeTax=\"18660.0\" CurrencyCode=\"HKD\"/>\n" +
                " </RoomStay>\n" +
                " </RoomStays>\n" +
                " <ResGuests>\n" +
                " 10,11<ResGuest ResGuestRPH=\"1\" PrimaryIndicator=\"true\">\n" +
                " <Profiles>\n" +
                " <ProfileInfo>\n" +
                " <Profile>\n" +
                " <Customer>\n" +
                " <PersonName>\n" +
                " 12<NamePrefix>MR</NamePrefix>\n" +
                " 13<GivenName>KEL01</GivenName>\n" +
                " 14<Surname>TEST ADH</Surname>\n" +
                " </PersonName>\n" +
                " </Customer>\n" +
                " </Profile>\n" +
                " </ProfileInfo>\n" +
                " </Profiles>\n" +
                " <ArrivalTransport>\n" +
                " 15,16,17<TransportInfo Type=\"Flight\" ID=\"0715\" Time=\"2021-03-25T10:29:00\" />\n" +
                " </ArrivalTransport>\n" +
                " <DepartureTransport>\n" +
                " 18,19,20<TransportInfo Type=\"Flight\" ID=\"0716\" Time=\"2021-03-25T10:10:00\" />\n"+
                "</DepartureTransport>\n" +
                " <GuestCounts>\n" +
                " <GuestCount AgeQualifyingCode=\"10\" />\n" +
                " </GuestCounts>\n" +
                " </ResGuest>\n" +
                " <ResGuest ResGuestRPH=\"2\">\n" +
                " <Profiles>\n" +
                " <ProfileInfo>\n" +
                " <Profile>\n" +
                " <Customer>\n" +
                " <PersonName>\n" +
                " <NamePrefix>MR</NamePrefix>\n" +
                " <GivenName>CHILD</GivenName>\n" +
                " <Surname>TEST ADH</Surname>\n" +
                " </PersonName>\n" +
                " </Customer>\n" +
                " </Profile>\n" +
                " </ProfileInfo>\n" +
                " </Profiles>\n" +
                " <ArrivalTransport>\n" +
                " <TransportInfo Type=\"Flight\" ID=\"0715\" Time=\"2021-03-25T10:29:00\" />\n" +
                " </ArrivalTransport>\n" +
                " <DepartureTransport>\n" +
                " <TransportInfo Type=\"Flight\" ID=\"0716\" Time=\"2021-03-25T10:10:00\" />\n" +
                " </DepartureTransport>\n" +
                " <GuestCounts>\n" +
                " 21, 22<GuestCount AgeQualifyingCode=\"8\" Age=\"5\" />\n" +
                " </GuestCounts>\n" +
                " </ResGuest>\n" +
                " <ResGuest ResGuestRPH=\"3\">\n" +
                " <Profiles>\n" +
                " <ProfileInfo>\n" +
                " <Profile>\n" +
                " <Customer>\n" +
                " <PersonName>\n" +
                " <NamePrefix>MR</NamePrefix>\n" +
                " <GivenName>KEL 03</GivenName>\n" +
                " <Surname>TEST ADH</Surname>\n" +
                " </PersonName>\n" +
                " </Customer>\n" +
                " </Profile>\n" +
                " </ProfileInfo>\n" +
                " </Profiles>\n" +
                " <ResGuest ResGuestRPH=\"4\">\n" +
                " <Profiles>\n" +
                " <ProfileInfo>\n" +
                " <Profile>\n" +
                " <Customer>\n" +
                " <PersonName>\n" +
                " <NamePrefix>MR</NamePrefix>\n" +
                " <GivenName>KEL 04</GivenName>\n" +
                " <Surname>TEST ADH</Surname>"+
                "</PersonName>\n" +
                " </Customer>\n" +
                " </Profile>\n" +
                " </ProfileInfo>\n" +
                " </Profiles>\n" +
                " <ArrivalTransport>\n" +
                " <TransportInfo Type=\"Flight\" ID=\"0715\" Time=\"2021-03-25T10:29:00\" />\n" +
                " </ArrivalTransport>\n" +
                " <DepartureTransport>\n" +
                " <TransportInfo Type=\"Flight\" ID=\"0716\" Time=\"2021-03-25T10:10:00\" />\n" +
                " </DepartureTransport>\n" +
                " <GuestCounts>\n" +
                " <GuestCount AgeQualifyingCode=\"10\" />\n" +
                " </GuestCounts>\n" +
                " </ResGuest>\n" +
                " </ResGuests>\n" +
                " <ResGlobalInfo>\n" +
                " <SpecialRequests>\n" +
                " <SpecialRequest>\n" +
                " 23<Text>abc</Text>\n" +
                " </SpecialRequest>\n" +
                " </SpecialRequests>\n" +
                " <Comments>\n" +
                " <Comment>\n" +
                " 31<Text>RqNonSmokingFloor</Text>\n" +
                " <Text>RqDblBed</Text>\n" +
                " <Text>RQEarlyCheckin</Text>\n" +
                " </Comment>\n" +
                " </Comments>\n" +
                " </ResGlobalInfo>\n" +
                " <TPA_Extensions>\n" +
                " <Agent>\n" +
                " 24<ContactPerson>OPH</ContactPerson>\n" +
                " 25<EmailOrFax>pakho.or@hkwtl.com</EmailOrFax>\n" +
                " 26<Phone>23139735</Phone>\n" +
                " </Agent>\n" +
                " </TPA_Extensions>\n" +
                " </HotelReservation>\n" +
                " </HotelReservations>\n" +
                "</OTA_HotelResRQ>\n";
        String result = callAPIFunc("text/xml;charset=utf-8", "http://ws.adholidays.com/hotelapidev/otaservice.aspx", param,"POST");
        System.out.println(result);
    }

}
